package com.security03.controller;

import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/users")
public class UsersController {
    @RequestMapping("/find")
    @PreAuthorize("hasAnyAuthority('/users/find')")
    public String find(){
        return "find";
    }
    @RequestMapping("/update")
    @PreAuthorize("hasAnyAuthority('/users/update')")
    public String update(){
        return "update";
    }
    @RequestMapping("/save")
    @PreAuthorize("hasAnyAuthority('/users/save')")
    public String save(){
        return "save";
    }
    @RequestMapping("/delete")
    @PreAuthorize("hasAnyAuthority('/users/delete')")
    public String delete(){
        return "delete";
    }
}
